package com.demo.designmode.factory.method2;

/**
 * @Author: jxm
 * @Description:
 * @Date: 2024-1-10 14:47
 * @Version: 1.0
 */
public class Client {

    public static void main(String[] args) {
        CoffeeFactory factory = new AmericanCoffeeFactory();
        CoffeeStore coffeeStore = new CoffeeStore(factory);
        Coffee coffee = coffeeStore.orderCoffee("");
        coffee.addSugar();
        coffee.addMilk();
        System.out.println();
        factory = new LatteCoffeeFactory();
        coffeeStore = new CoffeeStore(factory);
        coffee = coffeeStore.orderCoffee("");
        coffee.addSugar();
        coffee.addMilk();
    }
}
